<?php
/* @var $this AnalysisController */

?>
<?php $form=$this->beginWidget('CActiveForm', array(
		'id'=>'proPromotion-form',
		'enableAjaxValidation'=>false,
		'htmlOptions'=>array('class'=>'create_box')
	)); ?>
	<ul class="form_list form_list2">
		<li class="c_f title"><h3 class="fs_14">创建优惠券</h3></li>
		<li class="c_f"><span class="tit">面值：</span>
			<div class="cont f_l">
				<?php echo $form->dropDownList($model,'zti_value',Ticket::model()->getZtiValue(),array('class'=>'s_ipt w_80','empty'=>'选择面值'))?>
				<span id="Ticket_zti_valueTip"></span>
			</div>
		</li> 
		<li class="c_f"><span class="tit">开始结束时间：</span>
			<div class="cont f_l">
				<?php echo $form->textField($model,'zti_start_time',array('onclick'=>"WdatePicker()"))?>
				<span class="c_999">-</span>
				<?php echo $form->textField($model,'zti_end_time',array('onclick'=>"WdatePicker()"))?>
				<?php echo $form->error($model,'zti_start_time')?>
				<span id="Ticket_zti_start_timeTip"></span>
			</div>
		</li>
		<li class="c_f"><span class="tit">发放数量：</span>
			<div class="cont f_l">
				<?php echo $form->textField($model,'zti_inventory',array('class'=>'t_ipt w_170'))?>张 
				<span id="Ticket_zti_inventoryTip"></span>
			</div>
		</li>
		<li class="c_f"><span class="tit">每人限领数量：</span>
			<div class="cont f_l">
				<?php echo $form->textField($model,'zti_limitget',array('class'=>'t_ipt w_170'))?>张 
				<span id="Ticket_zti_limitgetTip"></span>
			</div>
		</li>
		<li class="c_f"><span class="tit">使用条件：</span>
			<div class="cont f_l">
				<ul class="sub_li">
					<li><?php echo CHtml::radioButton('condition',empty($model->zti_condition),array('class'=>'radio','value'=>1))?>不限</li>
					<li><?php echo CHtml::radioButton('condition',!empty($model->zti_condition),array('class'=>'radio','value'=>2))?>订单满 <?php echo $form->textField($model,'zti_condition',array('class'=>'t_ipt w_80'))?>元</li>
				</ul>
			</div>
		</li>
		<li class="c_f"><span class="tit">选择优惠券皮肤：</span>
			<div class="cont f_l">
				<ul class="skin_li c_f">
				<?php foreach(Ticket::model()->getZtiPic() as $key=>$val){?>
					<li><div class="<?php echo $val?>"><span class="value"><?php echo round($model->zti_value)?></span></div><p class="t_c">
						<?php echo CHtml::radioButton('Ticket[zti_pic]',($model->zti_pic==$val),array('class'=>'radio','value'=>$val))?>默认</p>
					</li>
				<?php }?>
				</ul>
			</div>
		</li>
		<li class="c_f save_link"><span class="tit">&nbsp;</span>
			<div class="cont f_l">
				<?php echo CHtml::submitButton(Yii::t('cmp','Update Set'),array('class'=>'mem_btn mem_btn20 mr5'))?>
				<?php echo CHtml::resetButton(Yii::t('cmp','Reset'),array('class'=>'mem_btn mem_btn07'))?>
			</div>
		</li>
	</ul>
<?php $this->endWidget(); ?>

 <script language="javascript" type="text/javascript" src="<?php echo Yii::app()->baseUrl;?>/js/My97DatePicker/WdatePicker.js"></script>
 
 <!-- 表单验证 -->
<script type="text/javascript" src="<?php echo Yii::app()->baseUrl;?>/js/formvalidata/formValidator-4.1.1.js"></script>
<script type="text/javascript" src="<?php echo Yii::app()->baseUrl;?>/js/formvalidata/formValidatorRegex.js"></script>
 <script>
	jQuery(document).ready(function($) {
		$.formValidator.initConfig({theme:"Default",formID:"proPromotion-form",
			onError:function(msg, obj){
					//	alert(msg);
						return false;
					},
			onsuccess:function(){ return true; }
		});
	})
</script>
<script type="text/javascript" src="<?php echo Yii::app()->baseUrl;?>/js/formvalidata/cmpValidate.js"></script> 
 